Patent Document 1 discloses a semiconductor device having a diode element. The semiconductor device includes an n-type semiconductor substrate, an n-type epitaxial layer formed on the semiconductor substrate, an n-type semiconductor region formed in the n-type epitaxial layer, a p-type semiconductor region formed on the n-type semiconductor region, an insulating film formed on the n-type epitaxial layer, an anode electrode connected through the insulating film to the p-type semiconductor region, and a cathode electrode connected to the other surface of the semiconductor substrate.